﻿<UserControl x:Class="PatternLocker.Controls.CircularButton"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:primitives="clr-namespace:System.Windows.Controls.Primitives;assembly=PresentationFramework" 
             mc:Ignorable="d" Background="Black" 
             d:DesignHeight="300" d:DesignWidth="300">

    <Grid>
        <Rectangle Name="rectColour" Visibility="Collapsed" />
        <primitives:ToggleButton Name="btnCircle" Checked="btnMainDot_CheckedChanged" 
                                 Unchecked="btnMainDot_CheckedChanged">
            <primitives:ToggleButton.Template>
                <ControlTemplate x:Name="tmpltCircle" TargetType="primitives:ToggleButton">
                    <Grid Name="grdCircle">
                        <Ellipse Name="elpCircle" Fill="{Binding ElementName=rectColour, Path=Fill, Mode=TwoWay}">
                            <!--Stroke="Black" StrokeThickness="2"-->

                            <!-- http://www.codeproject.com/Articles/32257/A-Style-for-Round-Glassy-WPF-Buttons -->
                            <!--<Ellipse.Fill>
                                <RadialGradientBrush GradientOrigin="0.496,1.052">
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.5" ScaleY="1.5"/>
                                            <TranslateTransform X="0.02" Y="0.3"/>
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Offset="1" Color="#FFFFFFFF"/>
                                    <GradientStop Offset="0.4" Color="GreenYellow"/>
                                </RadialGradientBrush>
                            </Ellipse.Fill>-->
                            <!--<Ellipse.Fill>
                                <RadialGradientBrush GradientOrigin="0.498,0.526">
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1" ScaleY="1.997"/>
                                            <TranslateTransform X="0" Y="0.5"/>
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Offset="1" Color="#FFFFFFFF"/>
                                    <GradientStop Offset="0.85" Color="#92FFFFFF"/>
                                    <GradientStop Offset="0" Color="#00000000"/>
                                </RadialGradientBrush>
                            </Ellipse.Fill>-->

                            <!--<Ellipse.Fill>
                                <RadialGradientBrush>
                                    <GradientStop Offset="0" Color="Lime" />
                                    <GradientStop Offset="1" Color="Lime" />
                                    <GradientStop Offset="1" Color="Gold" />
                                    <RadialGradientBrush.Transform>
                                        <TransformGroup>
                                            <ScaleTransform ScaleY="0.65" />
                                        </TransformGroup>
                                    </RadialGradientBrush.Transform>
                                </RadialGradientBrush>
                            </Ellipse.Fill>-->
                        </Ellipse>
                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    </Grid>
                </ControlTemplate>
            </primitives:ToggleButton.Template>
        </primitives:ToggleButton>
    </Grid>
</UserControl>
